package cn.cmdr.service.ServiceImpl;

import cn.cmdr.mapper.OrderItemMapper;
import cn.cmdr.pojo.OrderItem;
import cn.cmdr.service.OrderItemService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("orderItemService")
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
    @Resource
    private OrderItemMapper orderItemMapper;
    @Override
    public List<OrderItem> getOrdItem(Integer orderId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("order_id",orderId);
        return orderItemMapper.selectList(queryWrapper);
    }

    @Override
    public List<OrderItem> getOrdItemTwo(Integer id) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id",id);
        return orderItemMapper.selectList(queryWrapper);
    }
}
